#include<bits/stdc++.h>
#define int long long
namespace IO{
    template<typename T>
    void read(T &x){
        char ch=getchar();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getchar();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getchar();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    template <typename _Tp>
    void write(_Tp x) {
        if(x<0) x=(~x+1),putchar('-');
        if(x>9) write(x/10);
        putchar(x%10+'0');
    }
}
using namespace std;
using namespace IO;
const int N=1e6+5,mod=998244353;
int n,q,now[N];
vector<int> e[N];
signed main() {
#ifndef KAxdd
#ifndef ONLINE_JUDGE
    freopen(".in","r",stdin);
    freopen(".out","w",stdout);
#endif
#endif
    read(n,q);
    for(int i=1;i<=n;i++) {
        int len; read(len);
        for(int j=1;j<=len;j++) {
            int x; read(x);
            e[i].push_back(x);
        }
    }
    // if(n<=2000 && q<=2000) {

    // }
    return 0;
}